# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-netpacket
_pkgname=NetPacket
pkgver=1.7.2
pkgrel=6
pkgdesc='Assemble/disassemble network packets at the protocol level.'
arch=('any')
url='http://search.cpan.org/dist/NetPacket/'
license=('PerlArtistic')
makedepends=('perl-module-build>=0.360.100')
provides=('perl-netpacket-arp=0.43.1' 'perl-netpacket-ethernet=0.43.1'
          'perl-netpacket-icmp=0.43.1' 'perl-netpacket-icmpv6=0.43.1'
          'perl-netpacket-igmp=0.43.1' 'perl-netpacket-ip=0.43.1'
          'perl-netpacket-ipv6=0.43.1' 'perl-netpacket-pflog=0.43.1'
          'perl-netpacket-tcp=0.43.1' 'perl-netpacket-udp=0.43.1')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/Y/YA/YANICK/$_pkgname-$pkgver.tar.gz")
sha512sums=('94fb9b99f8d5443cce76c943ab562b44ee07448b0fbdd86bea35e0dc1aeabbce3871d7115f68c8ca013ad71390c51f2d5233a8f4ad71d796920c3f286cecf4c5')

build() {
  cd "$_pkgname-$pkgver"

  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd "$_pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  find "$pkgdir" -name perllocal.pod -delete
  find "$pkgdir" -name .packlist -delete
}

